/**
 * <copyright>
 *
 * Copyright (c) 2011 Zeligsoft (2009) Limited
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors: 
 *   Zeligsoft (2009) Limited - Initial API and implementation
 *
 * </copyright>
 *
 */
package org.omg.deployment;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.common.util.Enumerator;

/**
 * <!-- begin-user-doc -->
 * A representation of the literals of the enumeration '<em><b>Resource Usage Kind</b></em>',
 * and utility methods for working with them.
 * <!-- end-user-doc -->
 * @see org.omg.deployment.DeploymentPackage#getResourceUsageKind()
 * @model extendedMetaData="name='ResourceUsageKind'"
 * @generated
 */
public enum ResourceUsageKind implements Enumerator {
	/**
	 * The '<em><b>None</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #NONE_VALUE
	 * @generated
	 * @ordered
	 */
	NONE(0, "None", "None"),

	/**
	 * The '<em><b>Instance Uses Resource</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #INSTANCE_USES_RESOURCE_VALUE
	 * @generated
	 * @ordered
	 */
	INSTANCE_USES_RESOURCE(1, "InstanceUsesResource", "InstanceUsesResource"),

	/**
	 * The '<em><b>Resource Uses Instance</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #RESOURCE_USES_INSTANCE_VALUE
	 * @generated
	 * @ordered
	 */
	RESOURCE_USES_INSTANCE(2, "ResourceUsesInstance", "ResourceUsesInstance"),

	/**
	 * The '<em><b>Port Uses Resource</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #PORT_USES_RESOURCE_VALUE
	 * @generated
	 * @ordered
	 */
	PORT_USES_RESOURCE(3, "PortUsesResource", "PortUsesResource"),

	/**
	 * The '<em><b>Resource Uses Port</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #RESOURCE_USES_PORT_VALUE
	 * @generated
	 * @ordered
	 */
	RESOURCE_USES_PORT(4, "ResourceUsesPort", "ResourceUsesPort");

	/**
	 * The '<em><b>None</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>None</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #NONE
	 * @model name="None"
	 * @generated
	 * @ordered
	 */
	public static final int NONE_VALUE = 0;

	/**
	 * The '<em><b>Instance Uses Resource</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>Instance Uses Resource</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #INSTANCE_USES_RESOURCE
	 * @model name="InstanceUsesResource"
	 * @generated
	 * @ordered
	 */
	public static final int INSTANCE_USES_RESOURCE_VALUE = 1;

	/**
	 * The '<em><b>Resource Uses Instance</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>Resource Uses Instance</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #RESOURCE_USES_INSTANCE
	 * @model name="ResourceUsesInstance"
	 * @generated
	 * @ordered
	 */
	public static final int RESOURCE_USES_INSTANCE_VALUE = 2;

	/**
	 * The '<em><b>Port Uses Resource</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>Port Uses Resource</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #PORT_USES_RESOURCE
	 * @model name="PortUsesResource"
	 * @generated
	 * @ordered
	 */
	public static final int PORT_USES_RESOURCE_VALUE = 3;

	/**
	 * The '<em><b>Resource Uses Port</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>Resource Uses Port</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #RESOURCE_USES_PORT
	 * @model name="ResourceUsesPort"
	 * @generated
	 * @ordered
	 */
	public static final int RESOURCE_USES_PORT_VALUE = 4;

	/**
	 * An array of all the '<em><b>Resource Usage Kind</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static final ResourceUsageKind[] VALUES_ARRAY = new ResourceUsageKind[] {
			NONE, INSTANCE_USES_RESOURCE, RESOURCE_USES_INSTANCE,
			PORT_USES_RESOURCE, RESOURCE_USES_PORT, };

	/**
	 * A public read-only list of all the '<em><b>Resource Usage Kind</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final List<ResourceUsageKind> VALUES = Collections
			.unmodifiableList(Arrays.asList(VALUES_ARRAY));

	/**
	 * Returns the '<em><b>Resource Usage Kind</b></em>' literal with the specified literal value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static ResourceUsageKind get(String literal) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			ResourceUsageKind result = VALUES_ARRAY[i];
			if (result.toString().equals(literal)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Resource Usage Kind</b></em>' literal with the specified name.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static ResourceUsageKind getByName(String name) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			ResourceUsageKind result = VALUES_ARRAY[i];
			if (result.getName().equals(name)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Resource Usage Kind</b></em>' literal with the specified integer value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static ResourceUsageKind get(int value) {
		switch (value) {
		case NONE_VALUE:
			return NONE;
		case INSTANCE_USES_RESOURCE_VALUE:
			return INSTANCE_USES_RESOURCE;
		case RESOURCE_USES_INSTANCE_VALUE:
			return RESOURCE_USES_INSTANCE;
		case PORT_USES_RESOURCE_VALUE:
			return PORT_USES_RESOURCE;
		case RESOURCE_USES_PORT_VALUE:
			return RESOURCE_USES_PORT;
		}
		return null;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final int value;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String name;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String literal;

	/**
	 * Only this class can construct instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private ResourceUsageKind(int value, String name, String literal) {
		this.value = value;
		this.name = name;
		this.literal = literal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getValue() {
		return value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLiteral() {
		return literal;
	}

	/**
	 * Returns the literal value of the enumerator, which is its string representation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		return literal;
	}

} //ResourceUsageKind
